package com.peter.design.pattern.observer.event;

/**
 * @Auther: 肖冬
 * @Date: 2020/8/1 02:32
 * @Description:
 */
public class Client {

    public static void main(String[] args) {
        Writer writer = new Writer("肖冬");

        Reader reader1 = new Reader("读者1");
        Reader reader2 = new Reader("读者2");

        writer.registerListener(reader1);
        writer.registerListener(reader2);

        writer.addNovel("《设计模式概论》");

        writer.unregisterListener(reader1);
        writer.addNovel("《java从入门到放弃》");
    }
}
